
function TaskDefinitionDTO() {

	this.tasks = new Array();
}

TaskDefinitionDTO.prototype.setId = function(id) {
	this.id = id;
}

TaskDefinitionDTO.prototype.getId = function() {
	return this.id;
}

TaskDefinitionDTO.prototype.setCode = function(code) {
	this.code = code;
}

TaskDefinitionDTO.prototype.getCode = function() {
	return this.code;
}

TaskDefinitionDTO.prototype.setTitle = function(title) {
	this.title = title;
}

TaskDefinitionDTO.prototype.getTitle = function() {
	return this.title;
}

TaskDefinitionDTO.prototype.setDescription = function(description) {
	this.description = description;
}

TaskDefinitionDTO.prototype.getDescription = function() {
	return this.description;
}

TaskDefinitionDTO.prototype.setPreviousTask = function(previousTask) {
	this.previousTask = previousTask;
}

TaskDefinitionDTO.prototype.getPreviousTask = function() {
	return this.previousTask;
}

TaskDefinitionDTO.prototype.setParentTask = function(parentTask) {
	this.parentTask = parentTask;
}

TaskDefinitionDTO.prototype.getParentTask = function() {
	return this.previousTask;
}

TaskDefinitionDTO.prototype.isParentTaskOf = function(childTask) {
	var isParent = false;

	if(childTask.getParentTask()!=null) {
		if(childTask.getParentTask()==this) {
			isParent = true;
		} else {
			isParent = this.isParentTaskOf(childTask.getParentTask());
		}
	}
	
	return isParent;
}

TaskDefinitionDTO.prototype.addTask = function (childTask) {
	this.tasks[this.tasks.length] = childTask;
	childTask.setParentTask(this);
}

TaskDefinitionDTO.prototype.getTasks = function () {
	return this.tasks;
}
